﻿Public Class Forget

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        rs = New ADODB.Recordset
        rs.Open("select count(*) as e FROM account where password2 = '" & TextBox1.Text & "'", cn, 3, 2)
        Dim count As Integer
        If Not rs.EOF Then
            count = rs.Fields("e").Value
        End If
        rs.Close()
        rs = Nothing

        If count = 0 Then
            MsgBox("Wrong Personal Unlocking Code (PUC)")
        Else
            rs = New ADODB.Recordset
            rs.Open("SELECT * from account where password2 = '" & TextBox1.Text & "'", cn, 3, 2)
            MsgBox("Username: " + rs.Fields("username").Value + " ; Password: " + rs.Fields("password").Value)
            rs = Nothing
            LogIn.Show()
            Me.Close()
        End If

    End Sub

    Private Sub Forget_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Module1.connect()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        LogIn.Show()
        Me.Close()

    End Sub

    Private Sub Forget_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing


    End Sub

    Private Sub Forget_HelpButtonClicked(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.HelpButtonClicked

    End Sub
End Class